'use strict';
const Controller = require('egg').Controller;

class BooksController extends Controller {
  async index() {
    const { ctx } = this;
    const query = ctx.request.query;
    const res = await ctx.service.chapter.query(query.title);
    ctx.body = res; // 返回值显示
  }

  async add() {
    const { ctx } = this;
    const query = ctx.request.query;
    const res = await ctx.service.chapter.addChapter(query);
    ctx.body = res; // 返回值显示
  }

}
module.exports = BooksController;
